package com.video.system.service.impl;

import java.util.List;
import com.video.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.video.system.mapper.VideoCourseMapper;
import com.video.system.domain.VideoCourse;
import com.video.system.service.IVideoCourseService;

/**
 * 视频管理Service业务层处理
 * 
 * @author lyh
 * @date 2021-08-03
 */
@Service
public class VideoCourseServiceImpl implements IVideoCourseService 
{
    @Autowired
    private VideoCourseMapper videoCourseMapper;

    /**
     * 查询视频管理
     * 
     * @param cId 视频管理ID
     * @return 视频管理
     */
    @Override
    public VideoCourse selectVideoCourseById(Integer cId)
    {
        return videoCourseMapper.selectVideoCourseById(cId);
    }

    /**
     * 查询视频管理列表
     * 
     * @param videoCourse 视频管理
     * @return 视频管理
     */
    @Override
    public List<VideoCourse> selectVideoCourseList(VideoCourse videoCourse)
    {
        return videoCourseMapper.selectVideoCourseList(videoCourse);
    }

    /**
     * 新增视频管理
     * 
     * @param videoCourse 视频管理
     * @return 结果
     */
    @Override
    public int insertVideoCourse(VideoCourse videoCourse)
    {
        videoCourse.setCreateTime(DateUtils.getNowDate());
        return videoCourseMapper.insertVideoCourse(videoCourse);
    }

    /**
     * 修改视频管理
     * 
     * @param videoCourse 视频管理
     * @return 结果
     */
    @Override
    public int updateVideoCourse(VideoCourse videoCourse)
    {
        videoCourse.setUpdateTime(DateUtils.getNowDate());
        return videoCourseMapper.updateVideoCourse(videoCourse);
    }

    /**
     * 批量删除视频管理
     * 
     * @param cIds 需要删除的视频管理ID
     * @return 结果
     */
    @Override
    public int deleteVideoCourseByIds(Integer[] cIds)
    {
        return videoCourseMapper.deleteVideoCourseByIds(cIds);
    }

    /**
     * 删除视频管理信息
     * 
     * @param cId 视频管理ID
     * @return 结果
     */
    @Override
    public int deleteVideoCourseById(Integer cId)
    {
        return videoCourseMapper.deleteVideoCourseById(cId);
    }
}
